import Vue from 'vue';
import App from './App.vue';
import router from './middleware/autoRouter';
import store from './store';
import config from './config';
import './middleware/permission';

import '@/assets/css/index.scss';
import 'amfe-flexible';
import './middleware/filters'; // 自定义过滤器
import { NavBar,Icon,Divider,Field, Button, Image,Cell,CellGroup,ActionSheet,Popup,Stepper,Dialog } from 'vant';

Vue.use(Stepper);
Vue.use(Cell);
Vue.use(CellGroup);
Vue.use(Field);
Vue.use(Button);
Vue.use(Image);
Vue.use(ActionSheet);
Vue.use(Popup);
Vue.use(Dialog);

Vue.use(Divider);
Vue.use(Icon);
Vue.use(NavBar);

Vue.config.productionTip = false;

(async() => {
  let res = await config();

  Vue.prototype.$conf = res;
  store.dispatch('getUrlInfo', res);
  new Vue({
    router,
    store,
    render: h => h(App)
  }).$mount('#app');
})();
